#!/bin/bash

echo "set title \"Option value difference vs tree depth\"
set key right bottom
set xlabel \"Tree depth\"
set ylabel \"Option value difference\"
set output \"tree-value.png\"
set terminal png
plot \"-\" using 1:(column(2) - 8.14278) notitle
"

COUNT=40
until [ $COUNT -gt 1800 ]; do
	echo -n "$COUNT "
	let COUNT=COUNT-1
	./tree -c -E -s 0.1 -n $COUNT | tail -n-1 | awk '{ print $1, $2, $3}'
	let COUNT=COUNT+8
done 
echo "end"
